package com.ygqh.baby.service;

import com.ygqh.baby.ao.*;
import com.ygqh.baby.po.YgRechargeMemberRecord;
import com.ygqh.baby.po.YgUser;
import com.ygqh.baby.po.YgUserAddress;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

public interface YgRechargeMemberRecordService {

	List<YgRechargeMemberRecord> find();

	int findCount();

	YgRechargeMemberRecord findById(Long id);

	int deleteSoft(Long[] ids);

	int deleteSoft(Long id);

	int save(YgRechargeMemberRecord ygRechargeMemberRecord);

	int update(YgRechargeMemberRecord ygRechargeMemberRecord);

	int saveOrUpdate(YgRechargeMemberRecord ygRechargeMemberRecord);

	ResultSet<YgRechargeMemberRecord> search(QueryInfo queryInfo, String q, String nickName, CodeType rechargeRecordType);

	void doPaySuccessBusiness(Long paymentCode, BigDecimal paidPrice, Long userId, String transactionId, String cardIds, Date birthday);

	YgRechargeMemberRecord findByPaymentCode(Long parmentCode);

	@Deprecated
	int addRecord(Long userId, Long paymentCode, BigDecimal memberPrice, String memberType, PayType payType,
				  AppType appType);

	@Deprecated
	int addRecord(Long userId, Long paymentCode, BigDecimal memberPrice, String memberType, PayType payType,
				  AppType appType, String remark);

	int addRecord(Long userId, Long paymentCode, BigDecimal memberPrice, String memberType, PayType payType,
				  AppType appType, String remark, CodeType rechargeRecordType, String platformNo);

	@Deprecated
	Message saveMemberOrder(YgUser user, Long paymentCode, YgUserAddress address, String skuIds);

	@Deprecated
	YgRechargeMemberRecord findPaySuccessRecordByUserId(Long userId);

	/**
	 * 处理成为会员新逻辑，取消赠送卡券，添加代理自邀请记录
	 * 2018-05-16
	 *
	 * @param paymentCode
	 * @param paidPrice
	 * @param userId
	 * @param transactionId
	 */
	void doPaySuccessBusiness(Long paymentCode, BigDecimal paidPrice, Long userId, String transactionId);

	ResultSet<YgRechargeMemberRecord> searchCountVip(QueryInfo queryInfo, CodeType rechargeRecordType);

	ResultSet<YgRechargeMemberRecord> searchRecordByUserId(Long userId, CodeType rechargeRecordType);

	/**
	 * 女王充值记录退款成功
	 *
	 * @param rechargeMemberRecord 充值记录
	 * @param handler              操作人
	 * @param remark              remark
	 */
	void refundSuccess(YgRechargeMemberRecord rechargeMemberRecord, String handler, String remark);

	void refundRecord(Long id, String handler, String remark);
}
